add event_type_is_supported() for Publisher/Subscription.#3132
Open
fujitatomoya wants to merge 1 commit intorollingfrom
Open
add event_type_is_supported() for Publisher/Subscription.#3132fujitatomoya wants to merge 1 commit intorollingfrom
fujitatomoya wants to merge 1 commit intorollingfrom
Conversation
Signed-off-by: Tomoya Fujita <tomoya.fujita825@gmail.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a public runtime capability-check API to rclcpp so application code (and rclcpp tests) can determine whether specific publisher/subscription QoS event types are supported by the currently loaded RMW implementation, via PublisherBase/SubscriptionBase.
Changes:
- Add
PublisherBase::event_type_is_supported(rcl_publisher_event_type_t)andSubscriptionBase::event_type_is_supported(rcl_subscription_event_type_t)as public static APIs that forward torclsupport-check functions. - Update
test_qos_event.cppto use the newrclcppAPIs instead ofrmw_event_type_is_supported(...). - Add unit tests asserting the
rclcppAPI results match the underlyingrclresults.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| rclcpp/test/rclcpp/test_qos_event.cpp | Switches capability checks to the new rclcpp APIs and adds parity tests vs rcl. |
| rclcpp/src/rclcpp/subscription_base.cpp | Implements SubscriptionBase::event_type_is_supported() by forwarding to rcl_subscription_event_type_is_supported(). |
| rclcpp/src/rclcpp/publisher_base.cpp | Implements PublisherBase::event_type_is_supported() by forwarding to rcl_publisher_event_type_is_supported(). |
| rclcpp/include/rclcpp/subscription_base.hpp | Declares the new public static capability-check API for subscriptions with Doxygen docs. |
| rclcpp/include/rclcpp/publisher_base.hpp | Declares the new public static capability-check API for publishers with Doxygen docs. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
fujitatomoya
commented
Apr 15, 2026
Collaborator
Author
fujitatomoya
left a comment
There was a problem hiding this comment.
@ahcorde can you review this?
Comment on lines
+77
to
+78
| if (rclcpp::PublisherBase::event_type_is_supported(RCL_PUBLISHER_OFFERED_DEADLINE_MISSED) && | ||
| rclcpp::PublisherBase::event_type_is_supported(RCL_PUBLISHER_LIVELINESS_LOST)) |
Collaborator
Author
There was a problem hiding this comment.
now we have these APIs, so that call rclcpp APIs instead of rmws.
ahcorde
approved these changes
Apr 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
depends on ros2/rcl#1317
Fixes # (issue)
Is this user-facing behavior change?
No
Did you use Generative AI?
Yes Claude Code Opus4.6
Additional Information